/**
 * 过滤字符串首尾空格
 */
String.prototype.trim === undefined && (String.prototype.trim = function () {
	return this.replace(/(^\s*) | (\s*$)/g, "");
});

/**
 * 将 ‘>’ 和 ‘<’ 转成实体
 */
String.prototype.entity === undefined && (String.prototype.entity = function () {
	return this.replace(/[<>]/gm, function (word) {
		return word == "<" ? "&#60;" : "&#62;";
	});
});

/**
 * 将 ‘\n’ 替换成 ‘<br />’
 */
String.prototype.br === undefined && (String.prototype.br = function () {
	return this.replace(/\n/gm, "<br />");
});

/**
 * 转义双引号 ‘"’
 */
String.prototype.dblq === undefined && (String.prototype.dblq = function () {
	return this.replace(/(")/gm, "\\$1");
});

/**
 * 转义反斜杠 ‘\’
 */
String.prototype.backslash === undefined && (String.prototype.backslash = function () {
	return this.replace(/(\\)/gm, "\\$1");
});